import time

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select

drive = webdriver.Chrome()
drive.maximize_window()
drive.get("https://sahitest.com/demo/selectTest.htm")
time.sleep(1)
select = Select(drive.find_element(By.ID, "s1"))
# 根据index下标获取，从0开始
# select.select_by_index(0)
# 根据option的value选择
# select.select_by_value('50')
# 根据实际看到的文本内容选择
select.select_by_visible_text("Fax")
time.sleep(3)
drive.close()
